/**
 * Created by qunxing.du on 2016/7/28.
 * Copyright 2016 汉威.智慧环保事业部 Limited.
 * All rights reserved.
 */
package com.hw.one.collect.gdyc.memento;

import com.hw.one.collect.memento.Originator;

/**
 * 广德扬尘备忘录发起人
 */
public class GdycOriginator extends Originator<GdycMemento>{
    //开始时间
    private String startTime;
    //结束时间
    private String endTime;
    //记录次数
    private int count;
    public GdycOriginator(){}

    public GdycOriginator(String startTime,String endTime,int count){
        this.startTime = startTime;
        this.endTime = endTime;
        this.count = count;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    /**
     * 创建备忘录
     *
     * @return
     */
    @Override
    public GdycMemento createMemento() {
        return new GdycMemento(startTime,endTime,count);
    }

    /**
     * 恢复当前状态到指定的备忘录状态
     *
     * @param memento
     */
    @Override
    public void restoreMemento(GdycMemento memento) {
        this.startTime = memento.getStartTime();
        this.endTime = memento.getEndTime();
        this.count = memento.getCount();
    }
}
